import redis
db_config = {
    'host': '118.24.27.37',
    'db': 5,
    'charset': 'utf8'
}

conn = redis.StrictRedis(**db_config)
# 添加key
# conn.set("name", "longtao")
# result = conn.get("name")
# print(result)
# 查询所有key
# res = conn.keys()
# 列表
# res = conn.rpush('list_1', "lt1", "lt2", "lt3")
# res = conn.lrange("list_1",0 ,10)

# res = conn.sadd("aaa","adwd","dwad")
# TODO 旧版本 db.zadd(REDIS_KEY, score, member) 新版本 db.zadd(REDIS_KEY, {member:score})
# res = conn.zadd("set_2",{'ltzadd3':3})
# 查询所有有序集合值
# print(conn.zrange("set_2",0, -1))
